﻿@{
    var envAction = this.Url.Content("~/platform/env");
}
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title></title>
    <link id="icon" href="" rel="shortcut icon" />
    <meta charset="gb2312" />
    
    <link href="~/static/css/font-awesome.css" rel="stylesheet" />
    <link href="~/static/css/bootstrap-theme.css" rel="stylesheet" />
    <link href="~/static/css/bootstrap.css" rel="stylesheet" />
    <link href="~/static/css/minifox.css" rel="stylesheet" />
    <link href="~/static/css/common.css" rel="stylesheet" />
    <link href="~/static/css/frame.css" rel="stylesheet" />

    <script src="~/static/js/jquery-1.11.1.js"></script>
    <script src="~/static/js/jquery-ui-1.12.1.js"></script>
    <script src="~/static/js/bootstrap-3.3.7.js"></script>
    <script src="~/static/js/minifox.js"></script>
    <!-- https://open.dingtalk.com/document/orgapp/webapp-read-before-development
    <script src="~/static//js/dingtalk.open-3.0.25.js"></script> -->

    
    <script type="text/javascript">
        var serviceConfig = {
            "defaults": {
                "host": {
                    "BASE": ""
                },
                "autoMsg": false,
                "timeOut": 120000,
                "enableCookies": false,
                "showProcessing": true,
                "method": "post"
            },
            "adapters": [
                {
                    "name": "platform",
                    "host": "BASE",
                    "virtualPath": "",
                    "api": [
                        {
                            "name": "env",
                            "url": "@envAction",
                            "method": "get"
                        }
                    ]
                }
            ]
        };
        +function () {
            $(function(){

                var service = MiniFox.createService(serviceConfig);
                service.platform.env().then(function (response) {
                    if (!response.success) {
                        return;
                    }
                    var data = response.data;
                    $('title').text(data.title);
                    $('#icon').prop('href', data.iconUri);
                    $('#logo').prop('src', data.logoUri);
                    $('#description').text(data.description);
                    $('#copyright').text(data.copyright);
                    $('#icp').text(data.icp);
                });
            });

            if (window.top !== window.self) {
                window.top.location.href = window.location.href;
            }

            //对浏览器的UserAgent进行正则匹配，不含有钉钉独有标识的则为其他浏览器
            var useragent = navigator.userAgent;
            if (useragent.match(/@ApiGlobalKey.USER_AGENT_NAME/i) != '@ApiGlobalKey.USER_AGENT_NAME') {
                alert('已禁止本次访问：请使用钉钉内置浏览器访问本页面！');
                var opened = window.open('about:blank', '_self');
                opened.opener = null;
                opened.close();
            }

            




        }();
    </script>
    @this.RenderSection("Head", false)

</head>
<body>
    <div class="navbar navbar-inverse navbar-static-top head" role="navigation">
        <div class="logobar">
            <a class="navbar-brand"><img id="logo" alt="" /></a>
        </div>
    </div>

    <div class="container-fluid main" style="height:calc( 100% - 130px );">

        @RenderBody()
    </div>

    <div class="foot">
        <span id="description" class="pull-left"></span>
        <span id="copyright" class="pull-left"></span>
        <span class="pull-left"><a id="icp" href="http://www.beian.miit.gov.cn"></a></span>
    </div>
</body>
</html>
